<?php
namespace app\common\validate;

use think\Validate;

class CmsFieldValidate extends Validate
{
    // 验证规则
    protected $rule = [
        'title|字段标题'      => 'require',
        'field_name|字段名'  => 'require|alphaDash',
        'field_type|字段类型' => 'require',
    ];
    //验证场景
    protected $scene = [
        'add'  => ['title', 'field_name', 'field_type'],
        'edit' => ['title', 'table_name'],
    ];
}